package com.zsc.boot.exception;

import com.zsc.boot.common.ErrorType;

public class BusinessException extends RuntimeException {

    private final int code;

    public BusinessException(ErrorType code, String message) {
        super(message);
        this.code = code.getCode();
    }

    public BusinessException(ErrorType errorType) {
        super(errorType.getMsg());
        this.code = errorType.getCode();
    }

    public int getCode() {
        return code;
    }
}
